{php}
$has_value = 0;
if($vo['max']==1){
    if($vo['value']>0){
        $has_value = $vo['value'];
    }elseif( !empty($info[$vo['name']]) ){
        $has_value = $info[$vo['name']];
    }
}
{/php}
<div class="layui-form-item">
    <label class="layui-form-label">{$vo.title|raw|default=""}</label>
    <div class="layui-input-inline">
        {eq name="vo.max" value="1"}
        <div class="layui-upload-drag" id="upload_imgs_popup_{$vo.name}" style="padding:10px;">
            {if !$has_value }
            <div class="img-tips">
                <i class="layui-icon" style="font-size: 25px;">&#xe64a;</i>
                <p style="font-size: 12px;">添加图片</p>
            </div>
            {/if}
            <div class="imglist">
                {//直接赋值优先，数据库取值其次}
                {if $has_value }
                <div class="view" id="upload_imgs_popup_view_{$vo.name}">
                    <input type="hidden" name="{$vo.name}" value="{$vo.value}">
                    <img src="{$has_value|get_file_path}" style="max-width: 60px;max-height: 60px;">
                </div>
                {else/}
                <div class="view layui-hide" id="upload_imgs_popup_view_{$vo.name}">
                    <input type="hidden" name="{$vo.name}" value="0">
                    <img src="" style="max-width: 60px;max-height: 60px;">
                </div>
                {/if}
            </div>
        </div>
        {else/}
        <div class="more" style="display: flex;align-items: flex-start;" id="upload_imgs_popup_view_{$vo.name}">
            {notempty name="info[$vo.name]"}
                {if strpos($info[$vo.name],',')!==false }
                {volist name=":get_file_path($info[$vo.name])" id="v2"}
                <div class="img-list">
                    <img src="{$v2.url}" data-v="{$v2.id}">
                    <i class="layui-icon layui-icon-close del_imgs_{$vo.name}" ></i>
                </div>
                {/volist}
                {else/}
                <div class="img-list">
                    <img src="{$info[$vo.name]|get_file_path}" data-v="$info[$vo.name]">
                    <i class="layui-icon layui-icon-close del_imgs_{$vo.name}" ></i>
                </div>
                {/if}
            {/notempty}
            <div class="layui-upload-drag" id="upload_imgs_popup_{$vo.name}" style="padding:5px;">
                <div style="width: 49px;height: 49px;">
                    <i class="layui-icon" style="font-size: 20px;">&#xe64a;</i>
                    <p style="font-size: 12px;">添加图片</p>
                </div>
            </div>
            <input type="hidden" name="{$vo.name}" value="{$vo.value}">
        </div>
        {/eq}
    </div>
</div>
<style>
    .more .img-list{margin-right: 10px;border:1px dashed #e2e2e2;width: 60px;height: 60px;line-height: 60px;position: relative;}
    .more .img-list img{max-width: 60px;max-height: 60px;}
    .more .img-list i{position: absolute;right: -5px;top: -5px;font-size: 14px; background: #ff0000;
        line-height: 18px;color: #FFF;height: 18px;width: 18px;border-radius: 50px;text-align: center;}
</style>













